import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const DroneManagementMeta: IPublicTypeComponentMetadata = {
  componentName: 'DroneManagement',
  title: '无人机管理',
  category: '信息展示',
  group: '综合执法',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'DroneManagement',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
    {
      name: 'className',
      propType: 'string',
    },
    {
      name: 'width',
      propType: 'number',
      description: '容器宽度'
    },
    {
      name: 'height',
      propType: 'number',
      description: '容器高度'
    },
    {
      name: 'backgroundColor',
      propType: 'string',
      description: '容器背景色'
    },
    {
      name: 'borderRadius',
      propType: 'number',
      description: '容器圆角'
    },
    {
      name: 'drones',
      propType: 'array',
      description: '无人机数据配置'
    },
    {
      name: 'droneSpacing',
      propType: 'number',
      description: '无人机间距'
    },
    {
      name: 'droneWidth',
      propType: 'number',
      description: '无人机卡片宽度'
    },
    {
      name: 'droneHeight',
      propType: 'number',
      description: '无人机卡片高度'
    },
    {
      name: 'columns',
      propType: 'number',
      description: '列数'
    },
    {
      name: 'iconSize',
      propType: 'number',
      description: '图标大小'
    },
    {
      name: 'iconSpacing',
      propType: 'number',
      description: '图标间距'
    },
    {
      name: 'idFontSize',
      propType: 'number',
      description: '编号字体大小'
    },
    {
      name: 'idColor',
      propType: 'string',
      description: '编号颜色'
    },
    {
      name: 'idFontFamily',
      propType: 'string',
      description: '编号字体'
    },
    {
      name: 'idFontWeight',
      propType: 'number',
      description: '编号字体粗细'
    },
    {
      name: 'idLineHeight',
      propType: 'number',
      description: '编号行高'
    },
    {
      name: 'idLetterSpacing',
      propType: 'number',
      description: '编号字间距'
    },
    {
      name: 'idBackground',
      propType: 'string',
      description: '编号背景'
    },
    {
      name: 'progressHeight',
      propType: 'number',
      description: '进度条高度'
    },
    {
      name: 'progressWidth',
      propType: 'number',
      description: '进度条宽度'
    },
    {
      name: 'progressBorderWidth',
      propType: 'number',
      description: '进度条边框宽度'
    },
    {
      name: 'progressOpacity',
      propType: 'number',
      description: '进度条透明度'
    },
    {
      name: 'labelFontSize',
      propType: 'number',
      description: '标签字体大小'
    },
    {
      name: 'labelColor',
      propType: 'string',
      description: '标签颜色'
    },
    {
      name: 'labelFontFamily',
      propType: 'string',
      description: '标签字体'
    },
    {
      name: 'labelFontWeight',
      propType: 'number',
      description: '标签字体粗细'
    },
    {
      name: 'labelLineHeight',
      propType: 'number',
      description: '标签行高'
    },
    {
      name: 'labelLetterSpacing',
      propType: 'number',
      description: '标签字间距'
    },
    {
      name: 'valueFontSize',
      propType: 'number',
      description: '数值字体大小'
    },
    {
      name: 'valueColor',
      propType: 'string',
      description: '数值颜色'
    },
    {
      name: 'valueFontFamily',
      propType: 'string',
      description: '数值字体'
    },
    {
      name: 'valueFontWeight',
      propType: 'number',
      description: '数值字体粗细'
    },
    {
      name: 'valueLineHeight',
      propType: 'number',
      description: '数值行高'
    },
    {
      name: 'valueLetterSpacing',
      propType: 'number',
      description: '数值字间距'
    },
    {
      name: 'layout',
      propType: 'string',
      description: '布局方式'
    },
    {
      name: 'gap',
      propType: 'number',
      description: '间距'
    },
    {
      name: 'onDroneClick',
      propType: 'func',
      description: '无人机点击事件'
    },
    {
      name: 'onClick',
      propType: 'func',
      description: '点击事件'
    }
  ],
  configure: {
    props: [
      // 容器配置
      {
        name: 'container',
        type: 'group',
        display: 'accordion',
        title: {
          label: '容器配置',
        },
        items: [
          {
            name: 'width',
            title: { label: '容器宽度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 500 }
          },
          {
            name: 'height',
            title: { label: '容器高度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 400 }
          },
          {
            name: 'backgroundColor',
            title: { label: '容器背景色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: 'transparent' }
          },
          {
            name: 'borderRadius',
            title: { label: '容器圆角' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 0 }
          }
        ]
      },
      // 无人机数据配置
      {
        name: 'drones',
        type: 'group',
        display: 'accordion',
        title: {
          label: '无人机数据配置',
        },
        items: [
          {
            name: 'drones',
            title: { label: '无人机数据配置' },
            setter: { componentName: 'JsonSetter', isRequired: false, initialValue: [
              {
                id: 'A717-345',
                iconPath: 'http://localhost:8085/static/images/zonghezhifa/编组56.png',
                showProgress: true,
                progressValue: 75,
                progressColor: 'linear-gradient(90deg, rgba(52,165,255,0) 0%, rgba(52,165,255,0.39) 15%, rgba(52,165,255,0.45) 29%, rgba(52,165,255,0.35) 38%, rgba(52,165,255,0.14) 61%, rgba(0,139,255,0) 100%)',
                progressBackground: 'transparent',
                progressOpacity: 0.65,
                location: '40° N, 11° W',
                elevation: '57m',
                coordinates: 'X:13, Y:67, Z:11'
              },
              {
                id: 'A717-346',
                iconPath: 'http://localhost:8085/static/images/zonghezhifa/编组56.png',
                showProgress: true,
                progressValue: 60,
                progressColor: 'linear-gradient(90deg, rgba(52,165,255,0) 0%, rgba(52,165,255,0.39) 15%, rgba(52,165,255,0.45) 29%, rgba(52,165,255,0.35) 38%, rgba(52,165,255,0.14) 61%, rgba(0,139,255,0) 100%)',
                progressBackground: 'transparent',
                progressOpacity: 0.65,
                location: '41° N, 12° W',
                elevation: '45m',
                coordinates: 'X:15, Y:69, Z:8'
              },
              {
                id: 'A717-347',
                iconPath: 'http://localhost:8085/static/images/zonghezhifa/编组56.png',
                showProgress: true,
                progressValue: 85,
                progressColor: 'linear-gradient(90deg, rgba(52,165,255,0) 0%, rgba(52,165,255,0.39) 15%, rgba(52,165,255,0.45) 29%, rgba(52,165,255,0.35) 38%, rgba(52,165,255,0.14) 61%, rgba(0,139,255,0) 100%)',
                progressBackground: 'transparent',
                progressOpacity: 0.65,
                location: '39° N, 10° W',
                elevation: '62m',
                coordinates: 'X:11, Y:65, Z:14'
              }
            ]}
          },
          {
            name: 'droneSpacing',
            title: { label: '无人机间距' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 20 }
          },
          {
            name: 'droneWidth',
            title: { label: '无人机卡片宽度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 500 }
          },
          {
            name: 'droneHeight',
            title: { label: '无人机卡片高度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 120 }
          },
          {
            name: 'columns',
            title: { label: '列数' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 1 }
          }
        ]
      },
      // 图标配置
      {
        name: 'icon',
        type: 'group',
        display: 'accordion',
        title: {
          label: '图标配置',
        },
        items: [
          {
            name: 'iconSize',
            title: { label: '图标大小' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 75 }
          },
          {
            name: 'iconSpacing',
            title: { label: '图标间距' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 16 }
          }
        ]
      },
      // 编号配置
      {
        name: 'id',
        type: 'group',
        display: 'accordion',
        title: {
          label: '编号配置',
        },
        items: [
          {
            name: 'idFontSize',
            title: { label: '编号字体大小' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 22 }
          },
          {
            name: 'idColor',
            title: { label: '编号颜色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#1AD7FF' }
          },
          {
            name: 'idFontFamily',
            title: { label: '编号字体' },
            setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'DINAlternate' }
          },
          {
            name: 'idFontWeight',
            title: { label: '编号字体粗细' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 700 }
          },
          {
            name: 'idLineHeight',
            title: { label: '编号行高' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 22 }
          },
          {
            name: 'idLetterSpacing',
            title: { label: '编号字间距' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 0.79 }
          },
          {
            name: 'idBackground',
            title: { label: '编号背景' },
            setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'linear-gradient(90deg, #FFFFFF 0%, #81C6FF 100%)' }
          }
        ]
      },
      // 进度条配置
      {
        name: 'progress',
        type: 'group',
        display: 'accordion',
        title: {
          label: '进度条配置',
        },
        items: [
          {
            name: 'progressHeight',
            title: { label: '进度条高度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 30 }
          },
          {
            name: 'progressWidth',
            title: { label: '进度条宽度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 396 }
          },
          {
            name: 'progressBorderWidth',
            title: { label: '进度条边框宽度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 0 }
          },
          {
            name: 'progressOpacity',
            title: { label: '进度条透明度' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 0.65 }
          }
        ]
      },
      // 标签配置
      {
        name: 'label',
        type: 'group',
        display: 'accordion',
        title: {
          label: '标签配置',
        },
        items: [
          {
            name: 'labelFontSize',
            title: { label: '标签字体大小' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 14 }
          },
          {
            name: 'labelColor',
            title: { label: '标签颜色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: 'rgba(255,255,255,0.8)' }
          },
          {
            name: 'labelFontFamily',
            title: { label: '标签字体' },
            setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'SourceHanSansSC' }
          },
          {
            name: 'labelFontWeight',
            title: { label: '标签字体粗细' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 400 }
          },
          {
            name: 'labelLineHeight',
            title: { label: '标签行高' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 14 }
          },
          {
            name: 'labelLetterSpacing',
            title: { label: '标签字间距' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 0 }
          }
        ]
      },
      // 数值配置
      {
        name: 'value',
        type: 'group',
        display: 'accordion',
        title: {
          label: '数值配置',
        },
        items: [
          {
            name: 'valueFontSize',
            title: { label: '数值字体大小' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 16 }
          },
          {
            name: 'valueColor',
            title: { label: '数值颜色' },
            setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#56A5FF' }
          },
          {
            name: 'valueFontFamily',
            title: { label: '数值字体' },
            setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'DINAlternate' }
          },
          {
            name: 'valueFontWeight',
            title: { label: '数值字体粗细' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 700 }
          },
          {
            name: 'valueLineHeight',
            title: { label: '数值行高' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 16 }
          },
          {
            name: 'valueLetterSpacing',
            title: { label: '数值字间距' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 0 }
          }
        ]
      },
      // 布局配置
      {
        name: 'layout',
        type: 'group',
        display: 'accordion',
        title: {
          label: '布局配置',
        },
        items: [
          {
            name: 'layout',
            title: { label: '布局方式' },
            setter: {
              componentName: 'RadioGroupSetter',
              isRequired: false,
              initialValue: 'flex',
              props: {
                options: [
                  { label: '网格', value: 'grid' },
                  { label: '弹性', value: 'flex' }
                ]
              }
            }
          },
          {
            name: 'gap',
            title: { label: '间距' },
            setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 20 }
          }
        ]
      }
    ],
    supports: {
      style: true,
      className: true,
      events: ['onDroneClick', 'onClick']
    }
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '无人机管理',
    screenshot: '',
    schema: {
      componentName: 'DroneManagement',
      props: {
        width: 500,
        height: 298,
        backgroundColor: 'transparent',
        borderRadius: 0,
        drones: [
          {
            id: 'A717-345',
            iconPath: 'http://localhost:8085/static/images/zonghezhifa/编组56.png',
            showProgress: true,
            progressValue: 75,
            progressColor: 'linear-gradient(90deg, rgba(52,165,255,0) 0%, rgba(52,165,255,0.39) 15%, rgba(52,165,255,0.45) 29%, rgba(52,165,255,0.35) 38%, rgba(52,165,255,0.14) 61%, rgba(0,139,255,0) 100%)',
            progressBackground: 'transparent',
            progressOpacity: 0.65,
            location: '40° N, 11° W',
            elevation: '57m',
            coordinates: 'X:13, Y:67, Z:11'
          },
          {
            id: 'A717-346',
            iconPath: 'http://localhost:8085/static/images/zonghezhifa/编组56.png',
            showProgress: true,
            progressValue: 60,
            progressColor: 'linear-gradient(90deg, rgba(52,165,255,0) 0%, rgba(52,165,255,0.39) 15%, rgba(52,165,255,0.45) 29%, rgba(52,165,255,0.35) 38%, rgba(52,165,255,0.14) 61%, rgba(0,139,255,0) 100%)',
            progressBackground: 'transparent',
            progressOpacity: 0.65,
            location: '41° N, 12° W',
            elevation: '45m',
            coordinates: 'X:15, Y:69, Z:8'
          },
          {
            id: 'A717-347',
            iconPath: 'http://localhost:8085/static/images/zonghezhifa/编组56.png',
            showProgress: true,
            progressValue: 85,
            progressColor: 'linear-gradient(90deg, rgba(52,165,255,0) 0%, rgba(52,165,255,0.39) 15%, rgba(52,165,255,0.45) 29%, rgba(52,165,255,0.35) 38%, rgba(52,165,255,0.14) 61%, rgba(0,139,255,0) 100%)',
            progressBackground: 'transparent',
            progressOpacity: 0.65,
            location: '39° N, 10° W',
            elevation: '62m',
            coordinates: 'X:11, Y:65, Z:14'
          }
        ],
        droneSpacing: 20,
        droneWidth: 500,
        droneHeight: 120,
        columns: 1,
        iconSize: 75,
        iconSpacing: 16,
        idFontSize: 22,
        idColor: '#1AD7FF',
        idFontFamily: 'DINAlternate',
        idFontWeight: 700,
        idLineHeight: 22,
        idLetterSpacing: 0.79,
        idBackground: 'linear-gradient(90deg, #FFFFFF 0%, #81C6FF 100%)',
        progressHeight: 30,
        progressWidth: 396,
        progressBorderWidth: 0,
        progressOpacity: 0.65,
        labelFontSize: 14,
        labelColor: 'rgba(255,255,255,0.8)',
        labelFontFamily: 'SourceHanSansSC',
        labelFontWeight: 400,
        labelLineHeight: 14,
        labelLetterSpacing: 0,
        valueFontSize: 16,
        valueColor: '#56A5FF',
        valueFontFamily: 'DINAlternate',
        valueFontWeight: 700,
        valueLineHeight: 16,
        valueLetterSpacing: 0,
        layout: 'flex',
        gap: 20
      }
    }
  }
];

export default {
  ...DroneManagementMeta,
  snippets
};
